<script lang="ts" setup>
import axios from "axios";
import { onMounted, ref } from "vue";
let data = ref();
onMounted(() => {
  // axios.get("/api/getUserInfo")  url是自己定义的mock地址
  axios.get("/api/getUserInfo").then((res) => {
    console.log(res);
    data.value = res.data;
  });
});
</script>

<template>
  <p>{{ data }}基础实例</p>
</template>

<style scoped>
p {
  color: #d69e9e;
}
</style>
